package com.collect.tanzania.zhiBean.zhiSend;

import android.text.TextUtils;

import com.collect.tanzania.MyApplication;
import com.collect.tanzania.zhiGlobal.zhiAppSettings.ZHIProjectConfigs;
import com.collect.tanzania.zhiGlobal.zhiAppSettings.ZHIProjectConstants;
import com.collect.tanzania.zhiHelper.ZHIAdvertIDHelper;
import com.collect.tanzania.zhiHelper.ZHIDeviceHelper;
import com.collect.tanzania.zhiHelper.ZHIMainProcessHelper;
import com.zhi.syc.data_applist.ASGpsManagerGms;
import com.zhi.syc.data_applist.util.ASNetworkUtil;

import java.io.Serializable;

public class ZHISCheckInOutEntity implements Serializable {

    private String sysUserId;
    private String leaderUserId;

    private String clientType;
    private String version;
    private String sysLoginName;
    private String advertId;
    private String ip;
    private String mac;
    private String androidId;
    private String token;
    private String loginId;

    private String longitude;
    private String latitude;
    private String address;

    public ZHISCheckInOutEntity() {
        this.version = ZHIProjectConfigs.APP_VERSION;
        this.advertId = ZHIAdvertIDHelper.getInstance().getGoogleAdvertId();
        this.ip = ASNetworkUtil.getIPAddress(MyApplication.getAppContext());
        this.mac = ASNetworkUtil.getMacAddress(MyApplication.getAppContext());
        this.androidId = ZHIDeviceHelper.getInstance().getAndroidID();
        this.token = ZHIMainProcessHelper.getInstance().getToken();
        this.sysLoginName = ZHIMainProcessHelper.getInstance().getFullName();
        this.clientType = ZHIProjectConstants.APP_VERSION_CLIENT;
        this.loginId = ZHIMainProcessHelper.getInstance().getLoginId();

        this.sysUserId = ZHIMainProcessHelper.getInstance().getUserId();
        this.leaderUserId = ZHIMainProcessHelper.getInstance().getUserId();
    }

    public void updateLocationInfo() {
        this.longitude = ASGpsManagerGms.getInstance().mLongitude;
        this.latitude = ASGpsManagerGms.getInstance().mLatitude;
        this.address = ASGpsManagerGms.getInstance().mAddress;

        if (TextUtils.isEmpty(this.longitude)) {
            this.longitude = "8888";
        }
        if (TextUtils.isEmpty(this.latitude)) {
            this.latitude = "8888";
        }
        if (TextUtils.isEmpty(this.address)) {
            this.address = "8888";
        }
    }


    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getClientType() {
        return clientType;
    }

    public void setClientType(String clientType) {
        this.clientType = clientType;
    }

    public String getSysUserId() {
        return sysUserId;
    }

    public void setSysUserId(String sysUserId) {
        this.sysUserId = sysUserId;
    }

    public String getSysLoginName() {
        return sysLoginName;
    }

    public void setSysLoginName(String sysLoginName) {
        this.sysLoginName = sysLoginName;
    }

    public String getLeaderUserId() {
        return leaderUserId;
    }

    public void setLeaderUserId(String leaderUserId) {
        this.leaderUserId = leaderUserId;
    }

    public String getAdvertId() {
        return advertId;
    }

    public void setAdvertId(String advertId) {
        this.advertId = advertId;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }

    public String getAndroidId() {
        return androidId;
    }

    public void setAndroidId(String androidId) {
        this.androidId = androidId;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getLoginId() {
        return loginId;
    }

    public void setLoginId(String loginId) {
        this.loginId = loginId;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
